<template>
  <div class="MainDiv">
    <br />
    <el-divider>
      <el-button size="small" disabled>基本信息</el-button>
    </el-divider>
    <el-form
      ref="formRef"
      :model="ruleForm"
      :rules="rules"
      label-width="100px"
      class="demo-ruleForm"
      :size="formSize"
      status-icon
    >
      <el-row>
        <el-col :span="12"
          ><el-form-item label="BOM编号" prop="numberbom">
            <el-input
              disabled
              style="width: 370px"
              v-model="ruleForm.numberbom"
            /> </el-form-item
        ></el-col>
        <el-col :span="12"
          ><el-form-item label="默认BOM" prop="defaultbom">
            <el-radio-group v-model="ruleForm.defaultbom">
              <el-radio label="是" value="1" />
              <el-radio label="否" value="0" />
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="12"
          ><el-form-item label="BOM版本" prop="versionnumber">
            <el-input
              disabled
              style="width: 370px"
              v-model="ruleForm.versionnumber"
            /> </el-form-item
        ></el-col>
        <el-col :span="12">
          <el-form-item label="产品名称" prop="productname">
            <el-input
              @focus="bit = true"
              class="inputpopup"
              style="width: 335px"
              v-model="ruleForm.productname"
            />
            <button class="butpopup" @click="bit = true">产品选择</button>
          </el-form-item>
        </el-col>
        <el-col :span="12"
          ><el-form-item label="产品编号" prop="productnumber">
            <el-input
              disabled
              style="width: 370px"
              v-model="ruleForm.productnumber"
            /> </el-form-item
        ></el-col>
        <el-col :span="12"
          ><el-form-item label="规格型号" prop="productmodel">
            <el-input
              disabled
              style="width: 370px"
              v-model="ruleForm.productmodel"
            /> </el-form-item
        ></el-col>
        <el-col :span="12">
          <el-form-item label="单位" prop="unit">
            <el-select
              disabled
              v-model="ruleForm.unit"
              placeholder="请选择单位"
              style="width: 370px"
            >
              <el-option
                v-for="(a, index) in bindUnit"
                :key="index"
                :label="a.text"
                :value="a.text"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12"
          ><el-form-item label="日产量" prop="dailyproduction">
            <el-input
              style="width: 370px"
              v-model="ruleForm.dailyproduction"
            /> </el-form-item
        ></el-col>
      </el-row>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="ruleForm.remark" type="textarea" />
      </el-form-item>
      <el-form-item>
        <br />
        <br />
        <el-divider>
          <el-button size="small" disabled>物料配件</el-button>
        </el-divider>
        <el-button @click="whether = true">添加</el-button>

        <el-table
          ref="multipleTableRef"
          :data="BOMDetailsData"
          style="width: 100%; margin-top: 10px"
          @selection-change="handleSelectionChange4"
        >
          <el-table-column type="selection" width="55" />
          <el-table-column label="序号" property="id" width="100px">
          </el-table-column>
          <el-table-column
            label="物料编号"
            property="materialnumber"
            width="200px"
          >
          </el-table-column>
          <el-table-column label="物料名称" property="name" width="200px">
          </el-table-column>
          <el-table-column
            label="规格型号"
            property="specificationsversion"
            width="200px"
          >
          </el-table-column>
          <el-table-column label="单位" property="unit" width="200px">
          </el-table-column>
          <el-table-column
            label="物料类型"
            property="materialclassifyName"
            width="200px"
          >
          </el-table-column>
          <el-table-column
            label="物料属性"
            property="materialProperty"
            width="200px"
          >
          </el-table-column>
        </el-table>
      </el-form-item>
      <el-form-item>
        <el-divider>
          <el-button size="small" disabled>工艺路线</el-button>
        </el-divider>
        <el-button @click="bit1 = true"> 选择 </el-button>
        <br />
        <el-checkbox
          v-model="checked1"
          label="工艺路线"
          disabled
          style="width: 435px"
          size="large"
          border
        />
      </el-form-item>
    </el-form>

    <el-affix position="bottom" :offset="20">
      <div class="bottomdiv">
        <el-button type="primary" @click="submitForm(ruleForm)">
          确定
        </el-button>
        <el-button @click="resetForm(ruleForm)">重置</el-button>
      </div>
    </el-affix>

    <!-- ------------------------------------工艺路线弹框 ----------------------------------->
    <el-dialog width="50%" v-model="bit1" title="工艺路线">
      <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item>
            <el-input
              v-model="formInline.RoutecodedName"
              placeholder="请输入工艺路线名称/编号"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="getProcessRoute()"
              >查询</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <el-table
        :data="ProcessRouteShow"
        style="width: 100%"
        @selection-change="handleSelectionChange3"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="id" label="序号" width="100" />
        <el-table-column prop="routename" label="工艺路线名称" width="120" />
        <el-table-column prop="routecoded" label="工艺路线编号" width="160" />
        <el-table-column prop="routeexplain" label="工艺路线说明" width="150" />
      </el-table>
      <el-pagination
        @size-change="handleSizeChange2"
        @current-change="handleCurrentChange2"
        :current-page="pageindex3"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="pagesize3"
        layout="total, sizes, prev, pager, next, jumper"
        :total="PageCount"
      >
      </el-pagination>

      <el-divider />
      <el-button @click="bit1 = false">取消</el-button>
      <el-button type="primary" @click="BindProcessRoute">确认</el-button>
    </el-dialog>
    <!-- ------------------------------------产品弹框 ----------------------------------->
    <el-dialog width="50%" v-model="bit" title="产品">
      <el-form :inline="true" :model="query" class="demo-form-inline">
        <el-form-item>
          <el-input
            v-model="query.productid"
            placeholder="请输入产品编号/名称"
            style="width: 160px"
          />
        </el-form-item>
        <el-form-item>
          <el-select
            v-model="query.producttype"
            placeholder="请选择产品类型"
            clearable
            style="width: 160px"
          >
            <el-option
              v-for="(a, index) in bindType"
              :key="index"
              :label="a.text"
              :value="a.value"
              style="width: 160px"
            />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select
            style="width: 120px"
            clearable
            v-model="query.state"
            placeholder="请选择状态"
          >
            <el-option
              v-for="(a, index) in bindState"
              :key="index"
              :label="a.text"
              :value="a.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select
            v-model="query.productproperty"
            placeholder="请选择产品属性"
            clearable
            style="width: 140px"
          >
            <el-option
              v-for="(a, index) in bindProperty"
              :key="index"
              :label="a.text"
              :value="a.value"
            />
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="getData()">查询</el-button>
        </el-form-item>
      </el-form>
      <el-table
        ref="multipleTableRef"
        @selection-change="handleSelectionChange"
        :data="tableData"
        style="width: 100%"
      >
        <el-table-column type="selection" width="55" />

        <el-table-column
          property="id"
          label="序号"
          width="100px"
        ></el-table-column>
        <el-table-column property="productid" label="产品编号" width="100px">
        </el-table-column>
        <el-table-column
          property="productname"
          label="产品名称"
          width="100px"
        ></el-table-column>
        <el-table-column
          property="specification"
          label="规格型号"
          width="100px"
        ></el-table-column>
        <el-table-column
          property="units"
          label="单位"
          width="100px"
        ></el-table-column>
        <el-table-column
          property="producttype"
          label="产品类型"
          width="100px"
        ></el-table-column>
        <el-table-column
          property="productproperty"
          label="产品属性"
          width="100px"
        ></el-table-column>
      </el-table>
      <el-pagination
        v-model:current-page="query.pageindex"
        v-model:page-size="query.pagesize"
        :page-sizes="[5, 10, 15, 20]"
        :small="small"
        :disabled="disabled"
        :background="background"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalCount"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
      <el-divider />
      <el-button @click="bit = false">取消</el-button>
      <el-button type="primary" @click="BindProduct">确认</el-button>
    </el-dialog>
    <!--------------------==========----- 产品|物料 --------------------------------->
    <el-dialog width="50%" v-model="whether" title="添加物料配件">
      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
        <el-tab-pane label="物料" name="first">
          <el-form :inline="true" :model="query1" class="demo-form-inline">
            <el-form-item>
              <el-input
                v-model="query1.name"
                placeholder="请输入物料编号/名称"
                clearable
              />
            </el-form-item>
            <el-form-item>
              <el-select
                v-model="query1.materialtype"
                placeholder="请输入物料类型"
                clearable
              >
                <el-option label="生产物料" :value="1" />
                <el-option label="半成品" :value="2" />
                <el-option label="其他" :value="3" />
              </el-select>
            </el-form-item>
            <el-button
              type="primary"
              style="float: right; margin-left: 10px"
              @click="handleSearch"
              >查询</el-button
            >
            <el-button
              type="primary"
              style="float: right"
              @click="showstate = !showstate"
              >{{ showstate ? "收起" : "展开" }}</el-button
            >
            <div v-show="showstate">
              <el-form-item>
                <el-select
                  v-model="query1.state"
                  placeholder="请选择状态"
                  clearable
                >
                  <el-option label="全部" :value="-1" />
                  <el-option label="启用" :value="1" />
                  <el-option label="禁用" :value="2" />
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-cascader
                  :options="options"
                  :props="props1"
                  clearable
                  placeholder="请选择物料分类"
                  v-model="query1.materialclassify"
                />
              </el-form-item>
              <el-form-item>
                <el-select
                  v-model="query1.MaterialProperty"
                  placeholder="请选择物料属性"
                  clearable
                >
                  <el-option label="自制" :value="1" />
                  <el-option label="委外" :value="2" />
                  <el-option label="外购" :value="3" />
                  <el-option label="其他" :value="4" />
                </el-select>
              </el-form-item>
              <el-form-item> </el-form-item>
            </div>
          </el-form>
          <el-table
            ref="multipleTableRef"
            :data="tableMaterialData"
            style="width: 100%; margin-top: 10px"
            @selection-change="handleSelectionChange2"
          >
            <el-table-column type="selection" width="55" />
            <el-table-column label="序号" property="id" width="100px">
            </el-table-column>
            <el-table-column
              label="物料编号"
              property="materialnumber"
              width="100px"
            >
            </el-table-column>
            <el-table-column label="物料名称" property="name" width="100px">
            </el-table-column>
            <el-table-column
              label="规格型号"
              property="specificationsversion"
              width="100px"
            >
            </el-table-column>
            <el-table-column label="单位" property="unit" width="100px">
            </el-table-column>
            <el-table-column
              label="物料类型"
              property="materialclassifyName"
              width="100px"
            >
            </el-table-column>
            <el-table-column
              label="物料属性"
              property="materialProperty"
              width="100px"
            >
            </el-table-column>
          </el-table>
          <el-pagination
            v-model:current-page="query1.pageindex"
            v-model:page-size="query1.pagesize"
            :page-sizes="[5, 10, 15, 20]"
            :small="small"
            :disabled="disabled"
            :background="background"
            layout="total, sizes, prev, pager, next, jumper"
            :total="totalCount1"
            @size-change="handleSizeChange1"
            @current-change="handleCurrentChange1"
          />
        </el-tab-pane>
        <el-tab-pane label="产品" name="second">
          <el-form :inline="true" :model="query" class="demo-form-inline">
            <el-form-item>
              <el-input
                v-model="query.productid"
                placeholder="请输入产品编号/名称"
                style="width: 160px"
              />
            </el-form-item>
            <el-form-item>
              <el-select
                v-model="query.producttype"
                placeholder="请选择产品类型"
                clearable
                style="width: 160px"
              >
                <el-option
                  v-for="(a, index) in bindType"
                  :key="index"
                  :label="a.text"
                  :value="a.value"
                  style="width: 160px"
                />
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-select
                v-model="query.state"
                style="width: 160px"
                placeholder="请选择状态"
                clearable
              >
                <el-option
                  v-for="(a, index) in bindState"
                  :key="index"
                  :label="a.text"
                  :value="a.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-select
                v-model="query.productproperty"
                placeholder="请选择产品属性"
                clearable
                style="width: 170px"
              >
                <el-option
                  v-for="(a, index) in bindProperty"
                  :key="index"
                  :label="a.text"
                  :value="a.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item>
              <el-button type="primary" @click="getData()">查询</el-button>
            </el-form-item>
          </el-form>
          <el-table
            ref="multipleTableRef"
            @selection-change="handleSelectionChange1"
            :data="tableData"
            style="width: 100%"
          >
            <el-table-column type="selection" width="55" />

            <el-table-column
              property="id"
              label="序号"
              width="100px"
            ></el-table-column>
            <el-table-column
              property="productid"
              label="产品编号"
              width="100px"
            >
            </el-table-column>
            <el-table-column
              property="productname"
              label="产品名称"
              width="100px"
            ></el-table-column>
            <el-table-column
              property="specification"
              label="规格型号"
              width="100px"
            ></el-table-column>
            <el-table-column
              property="units"
              label="单位"
              width="100px"
            ></el-table-column>
            <el-table-column
              property="producttype"
              label="产品类型"
              width="100px"
            ></el-table-column>
            <el-table-column
              property="productproperty"
              label="产品属性"
              width="100px"
            ></el-table-column>
          </el-table>
          <el-pagination
            v-model:current-page="query.pageindex"
            v-model:page-size="query.pagesize"
            :page-sizes="[5, 10, 15, 20]"
            :small="small"
            :disabled="disabled"
            :background="background"
            layout="total, sizes, prev, pager, next, jumper"
            :total="totalCount"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </el-tab-pane>
      </el-tabs>
      <el-button class="but" @click="whether = false">取消</el-button>
      <el-button class="but" type="primary" @click="AddMaterialData"
        >确认</el-button
      >
    </el-dialog>
  </div>
</template>
   <script>

import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { reactive, toRefs, ref } from "vue";
import { Materialtype, ShowMaterial } from "../../api/Material";
import { POSTBOMDATA } from "../../api/BOM";
import { ProductShow, ProductClassShow } from "../../api/product";
import { GetDictionary } from "../../api/Dictionaries";
import { CraftProcessShow } from "../../api/craftprocess";
export default {
  setup() {
    const rules = {
      productname: [
        { required: true, message: "请输入产品名称", trigger: "blur" },
      ],
      defaultbom: [
        {
          required: true,
          message: "请选择默认BOM",
          trigger: "change",
        },
      ],
      processnumber: [
        { required: true, message: "请输入工艺路线", trigger: "blur" },
      ],
      dailyproduction: [
        { required: true, message: "请输入日产量", trigger: "blur" },
      ],
      remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
    };
    //BOM_物料产品
    const fromMaterial = {
      numberbom: "",
      materialnumber: "",
      usageamount: 0,
      useratio: 0,
      accessorytype: "1",
    };
    const formRef = ref(null);
     const router = useRouter();
    //BOM表单字段
    const ruleForm = ref({
      numberbom: "",
      versionnumber: "",
      productname: "",
      productnumber: "",
      productmodel: "",
      unit: "",
      defaultbom: "",
      dailyproduction: null,
      parentid: 0,
      processnumber: "",
      remark: "",
      materialData: [],
    });

    // 提交
    const submitForm = () => {
      // 表单校验
      formRef.value.validate((valid) => {
        if (valid) {
          console.log(ruleForm.value.materialData);
          if (ruleForm.value.materialData.length <= 0) {
            ElMessage.info("请选择物料配件");
          } else {
            if (checked1.value == true) {
              POSTBOMDATA(ruleForm.value).then((res) => {
                if (res.result > 0) {
                  ElMessage.success("添加成功");
                   router.push("/BOMShow");
                } else {
                  ElMessage.error("添加失败");
                }
              });
            } else {
              ElMessage.info("请选择工艺路线");
            }
          }
        } else {
          return false;
        }
      });
    };
    // 重置
    const onReset = () => {
      formRef.value.resetFields();
    };

    //弹框开关
    const bit = ref(false);
    const bit1 = ref(false);
    const whether = ref(false);
    const showstate = ref(false);
    //PopUpFalse();

    //--------------------------------------------------------产品----------------------------------------------//
    const tableData = ref([]);
    const totalCount = ref(0);
    const bindType = ref({});
    const bindState = ref({});
    const bindProperty = ref({});
    const options = ref([]);
    const bindUnit = ref([]);
   
    const query = reactive({
      pageindex: 1,
      pagesize: 5,
      productid: "",
      producttype: null,
      state: null,
      productproperty: null,
      productclassid: options.value.value,
    });
    const multipleSelection1 = ref([]);
    const multipleSelection = ref([]);
    //产品选择
    const handleSelectionChange = (val) => {
      multipleSelection.value = val;
    };
    //产品选择绑定
    const BindProduct = () => {
      if (multipleSelection.value.length == 1) {
        ruleForm.value.productname = multipleSelection.value[0].productname;
        ruleForm.value.productnumber = multipleSelection.value[0].productid;
        ruleForm.value.productmodel = multipleSelection.value[0].specification;
        ruleForm.value.unit = multipleSelection.value[0].units;
        ruleForm.value.versionnumber = 1.1;
        bit.value = false;
      } else {
        ElMessage.success("请选择一个产品");
      }
    };
    // 获取表格数据
    const getData = () => {
      ProductShow(query).then((res) => {
        tableData.value = res.result.items;
        totalCount.value = res.result.totalCount || 50;
      });
      GetDictionary("单位").then((res) => {
        bindUnit.value = res.result;
      });

      GetDictionary("产品类型").then((res) => {
        bindType.value = res.result;
      });
      GetDictionary("状态").then((res) => {
        bindState.value = res.result;
      });
      GetDictionary("产品属性").then((res) => {
        bindProperty.value = res.result;
      });
      ProductClassShow().then((res) => {
        options.value = res.result;
      });
    };
    getData();

    // 分页导航
    const handleSizeChange = (val) => {
      query.pagesize = val;
      getData();
    };
    // 分页导航
    const handleCurrentChange = (val) => {
      query.pageindex = val;
      getData();
    };
    //---------------------------------------------物料配件--------------------------------------------------------//
    //定义数据

    const BOMDetailsData = ref([]);
    const MaterialBOMData = ref([]);
    const ProductBOMData = ref([]);
    const ProductMaterialData = ref([]);
    const ProductModel = {
      accessorytype: "",
      id: 1,
      name: "",
      materialnumber: "",
      specificationsversion: "",
      unit: "",
      materialclassifyName: "",
      materialProperty: "",
    };
    const delMaterialData = ref([]);
    const tableMaterialData = ref([]);
    const totalCount1 = ref(0);
    const options1 = ref([]);
    const Materialtypedata = reactive([]);
    const Statedata = reactive([]);
    const MaterialPropertydata = reactive([]);
    //字典
    const MaterialList = () => {
      GetDictionary("物料类型").then((res) => {
        Materialtypedata.value = res.result;
      });
      GetDictionary("物料属性").then((res) => {
        MaterialPropertydata.value = res.result;
      });
      GetDictionary("状态").then((res) => {
        Statedata.value = res.result;
      });
    };
    MaterialList();
    //标题页（默认显示页）
    const activeName = ref("first");
    //分页&&查询参数
    const query1 = reactive({
      pageindex: 1,
      pagesize: 5,
      name: "",
      materialtype: null,
      state: null,
      materialclassify: null,
      materialProperty: null,
    });
    // 获取物料表格数据
    const getMaterialData = () => {
      ShowMaterial(query1).then((res) => {
        tableMaterialData.value = res.result.items;
        totalCount1.value = res.result.totalCount || 50;
      });

      Materialtype().then((res) => {
        options1.value = res.result;
      });
    };
    getMaterialData();

    // 查询操作
    const handleSearch = () => {
      getMaterialData();
    };

    // 分页导航
    const handleSizeChange1 = (val) => {
      query1.pagesize = val;
      query1.pageindex = 1;
      getData();
    };
    // 分页导航
    const handleCurrentChange1 = (val) => {
      query1.pageindex = val;
      getData();
    };
    // 删除操作
    const handleDelete = (index) => {
      // 二次确认删除
      ElMessageBox.confirm("确定要删除吗？", "提示", {
        type: "warning",
      })
        .then(() => {
          ElMessage.success("删除成功");
          tableData.value.splice(index, 1);
        })
        .catch(() => {});
    };
    //产品选择
    const handleSelectionChange1 = (val) => {
      if (val.length <= 0) {
        ProductMaterialData.value = val;
      } else {
        ProductMaterialData.value = val; //arr数组
      }
    };
    //物料选择
    const handleSelectionChange2 = (val) => {
      MaterialBOMData.value = val;
    };
    //配件确定
    const AddMaterialData = () => {
      //将push过的清空，将选择的值push进数组
      ProductBOMData.value = [];
      if (ProductMaterialData.value.length > 0) {
        //产品字段转物料字段
        ProductMaterialData.value.forEach(function (item, index, val) {
          ProductModel.accessorytype = "2";
          ProductModel.id = item.id;

          ProductModel.name = item.productname;
          ProductModel.unit = item.units;
          ProductModel.materialnumber = item.productid;
          ProductModel.specificationsversion = item.specification;
          ProductModel.materialProperty = item.productproperty;
          ProductModel.materialclassifyName = item.producttype;
          //  //[index].name=item[index].productname;
          ProductBOMData.value.push(JSON.parse(JSON.stringify(ProductModel)));
        });

        BOMDetailsData.value = MaterialBOMData.value.concat(
          ProductBOMData.value
        );
      } else {
        ProductMaterialData.value = [];
        BOMDetailsData.value = MaterialBOMData.value;
      }
      //将push过的清空，将选择的值push进数组
      ruleForm.value.materialData = [];
      //物料配件转物料信息
      BOMDetailsData.value.forEach(function (item, index, val) {
        fromMaterial.numberbom = ruleForm.value.numberbom;
        fromMaterial.accessorytype = item.accessorytype ?? "1";
        fromMaterial.materialnumber = item.materialnumber;
        ruleForm.value.materialData.push(
          JSON.parse(JSON.stringify(fromMaterial))
        );
      });
      //关闭弹出
      whether.value = false;
    };

    //工艺路线

    const checked1 = ref(false);
    const ProcessRouteShow = ref([]);
    const PageCount = ref(0);
    const multipleSelection2 = ref([]);
    const formInline = {
      pageindex3: 1,
      pagesize3: 10,
      routecodedName: "",
      routestate: "",
    };
    const getProcessRoute = () => {
      CraftProcessShow(formInline).then((ros) => {
        ProcessRouteShow.value = ros.result.items;
        PageCount.value = ros.result.totalCount;
      });
    };
    getProcessRoute();
    const handleSizeChange2 = (val) => {
      this.formInline.pagesize3 = val;
      this.getProcessRoute();
    };
    const handleCurrentChange2 = (val) => {
      this.formInline.pageindex3 = val;
      this.getProcessRoute();
    };
    //工艺路线选择绑定
    const BindProcessRoute = () => {
      if (multipleSelection2.value.length == 1) {
        ruleForm.value.processnumber = multipleSelection2.value[0].routecoded;

        checked1.value = true;
        bit1.value = false;
      } else {
        ElMessage.success("请选择一条工艺路线");
      }
    };
    const handleSelectionChange3 = (val) => {
      multipleSelection2.value = val;
    };

    return {
      rules,
      formRef,
      ruleForm,
      submitForm,
      onReset,
      bit,
      BindProduct,
      //  产品
      getData,
      query,
      tableData,
      totalCount,
      bindType,
      bindState,
      bindProperty,
      options,
      router,
      handleSizeChange,
      handleCurrentChange,
      bindUnit,
      multipleSelection1,
      handleSelectionChange,
      handleSelectionChange1,
      handleSelectionChange2,
      //物料
      whether,
      getMaterialData,
      showstate,
      query1,
      handleSizeChange1,
      handleCurrentChange1,
      tableMaterialData,
      handleSearch,
      options1,
      totalCount1,
      activeName,
      Materialtypedata,
      Statedata,
      MaterialPropertydata,
      MaterialList,
      GetDictionary,
      fromMaterial,
      BOMDetailsData,
      AddMaterialData,
      MaterialBOMData,
      ProductBOMData,
      ProductMaterialData,
      ProductModel,
      delMaterialData,
      //工艺路线
      bit1,
      formInline,
      handleCurrentChange2,
      handleSizeChange2,
      multipleSelection2,
      PageCount,
      ProcessRouteShow,
      getProcessRoute,
      BindProcessRoute,
      handleSelectionChange3,
      checked1,
    };
  },
};
</script>
<style>
.butpopup {
  float: left;
  width: 35px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inputpopup {
  float: left;
}
.but {
  align-content: center;
}
.bottomdiv {
  text-align: center;
  background-color: white;
  height: 120%;
  width: 100%;
}
.MainDiv {
  background-color: white;
}
</style>
